﻿using System;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Mvc;
using Inovout;
using Inovout.Data.Domain;
using Inovout.Data.Repository;
using Inovout.Data.Service;
using Inovout.Web.Mvc;
using KuaJing.Portal.Cms.Domain;
using NHibernate;

namespace KuaJing.Portal.WebPage.Controllers
{

    public class HomeController : RepositoryController<Content>
    {
        protected override void InitializeDataSources()
        {
            this.AddDataSource(m => m.Category, () => GetService<IRepository<Category>>().FindAll());
        }

        public override ActionResult Index(QueryCriteria queryCriteria)
        {
            return Json(DateTime.Now.ToString(), JsonRequestBehavior.AllowGet);
        }
        [HttpGet]
        public ActionResult Index()
        {
        
            return Json(DateTime.Now.ToString(),JsonRequestBehavior.AllowGet);
            var m = GetService<ISessionFactory>().OpenStatelessSession().Get<Content>(1);
            var model = ModelService.FindById(1);
          //  return RedirectToAction("New", "Category");

            return RedirectToAction("New", "Content");
            // return View(model);
        }
    }
}